<?php

class Comment extends Record {       
	protected $table = Options::DB_TABLE_COMMENTS;
		
	public function addNew(){
		
        return $this->save();
    }
    
    public function scopeNewsID($query, $criteria) {
    	return $query->where(Options::DB_TABLE_COMMENTS.'.newsID', '=', $criteria);
    }
    public function scopeIsPrimary( $query, $criteria) {
    	return $query->where(Options::DB_TABLE_COMMENTS.'.repliedTo', '=', Options::COMMENTS_PRIMARY_REPLIEDTO);
    }
}